import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class TestJar {

    public static void main(String[] args) throws Exception {
        List<String> list = new ArrayList<>();
        Files.readAllLines(Paths.get("D:\\testwork\\TBQG\\class.txt")).forEach(s -> {
            if (s.contains("TBQG") && !list.contains("TBQG")) {
                list.add(s.split("TBQG")[1]);
            }
        });

        Set<String> set = new HashSet<>(list);
        for (String s : set) {
            System.out.println(s);
        }
    }


}
